home *** CD-ROM | disk | FTP | other *** search
- // Figure 10 for "A Little CAD with C++"
- // Copyright 1988 Bruce Eckel
- // Permission required to distribute source
-
- // file: line.cpp
- #include "line.hpp"
- #include <msmouse.h>
- #include <fg.h>
-
- void line::draw() {
- msm_hidecursor();
- line_data [FG_X1] = x_center;
- line_data [FG_X2] = x_center + 30;
- line_data [FG_Y1] = y_center;
- line_data [FG_Y2] = y_center + 30;
- fg_drawline (FG_WHITE, FG_MODE_SET, ~0,
- FG_LINE_SOLID, line_data);
- msm_showcursor();
- }
-
- void line::erase() {
- msm_hidecursor();
- fg_drawline (FG_BLACK, FG_MODE_SET, ~0,
- FG_LINE_SOLID, line_data);
- msm_showcursor();
- }
-